package iSOCK::Model::Bugzilla::Digital;

use strict;
use base 'Catalyst::Model::DBIC::Schema';

use iSOCK::Model::App;

my $app = iSOCK::Model::App->new;

if ( $app ) {
  __PACKAGE__->config (
    schema_class => 'iSOCK::Schema::Bugzilla',
    connect_info => $app->bug_tracker_dsn ( 'digital' ),
  );
}
else {
  die 'Could not access App DB!';
}

=head1 NAME

iSOCK::Model::Bugzilla::Digital - Catalyst DBIC Schema Model

=head1 SYNOPSIS

See L<iSOCK>

=head1 DESCRIPTION

L<Catalyst::Model::DBIC::Schema> Model using schema L<iSOCK::Schema::Bugzilla::Digital>

=head1 GENERATED BY

Catalyst::Helper::Model::DBIC::Schema - 0.55

=head1 AUTHOR

Design Flow user

=head1 LICENSE

This library is free software, you can redistribute it and/or modify
it under the same terms as Perl itself.

=cut

sub component_name {
  my ( $self, $id, $process ) = @_;
  
  my $prefix = $process ? "$process-" : "";
  
  if ( my $component_r = $app->resultset ( 'Component' )->find ( $id ) ) {
    return $prefix . ( $component_r->bug_tracker_component_id || $id );
  }
  
  return $prefix . $id;
}

sub component_version {
  my ( $self, $version ) = @_;
  
  return $version;
}

1;
